#include "processBar.h"
const char* stu= "|/-\\";
void display(char* process, int cnt)
{
    size_t len = strlen(stu);
    printf("[%-100s][%d%%][%c]\r", process, cnt, stu[cnt%len]);
    fflush(stdout);
    usleep(100000);
}

void process_bar()
{
    char process[102];
    memset(process, '\0', sizeof(char)*102);
    int cnt = 0;
    while(cnt <= 100)
    {
        display(process, cnt);
        process[cnt++] = '=';
        if(cnt <= 100)
            process[cnt] = '>';
    }

    printf("\n");
}
